package demo4;

/**
 * Author：毕龙
 * Date: 2024/5/17 9:23
 */
public class TestStringChange {
    public static void main(String[] args) {
        StringBuffer sb = new StringBuffer("hello");
        System.out.println(System.identityHashCode(sb));
        sb.append(1);
        System.out.println(System.identityHashCode(sb));
        sb.append("world");
        System.out.println(System.identityHashCode(sb));
        System.out.println(sb);
        StringBuilder builder = new StringBuilder();
        builder.append(1);
        builder.append("xiaoniao");
        System.out.println(builder);
    }
}
